k8s sealos安装 | 您所在的位置:网站首页 › k8s elk › k8s sealos安装 |
k8s sealos安装
1.1 简介
官网地址: https://github.com/labring/sealos 基于kubeadm安装 附属: 他用go基于ssh协议写了一个远程传递工具他帮我们准备了资源包,里面包括安装脚本,配置文件和镜像,放在阿里云的存储上,不再需要担心网络问题影响部署https://www.sealyun.com/zh-Hans/docs/Intro 目前sealos不是完全免费的,1.1版本左右的是免费的,稳定版测试的版本。1.2.3是收费的,一年100左右 2.1 部署架构
对于kubeadm来说,同一个集群中如果有多个etcd,就会自动称为etcd集群,这是kubeadm的功能,不是etcd的。 3.1 安装前准备我们准备4台机器,组装三主一从,从节点没必要整那么多 192.168.40.130 k8s-master01 192.168.40.131 k8s-master02 192.168.40.132 k8s-master03 192.168.40.133 k8s-node1 //设置主机名 hostnamectl set-hostname k8s-master01 //拷贝主机文件到其他主机 cat /etc/hosts 192.168.40.130 k8s-master01 192.168.40.131 k8s-master02 192.168.40.132 k8s-master03 192.168.40.133 k8s-node1 scp /etc/hosts [email protected]:/etc/hosts ... //安装依赖包 yum install -y conntrack ntpdate ntp ipvsadm ipset iptables curl sysstat libseccomp wget vim net-tools git chrony //设置防火墙为 Iptables 并设置空规则 systemctl disable firewalld yum -y install iptables-services && systemctl start iptables && systemctl enable iptables && iptables -F && service iptables save //修改三个主节点的chrony,让他到阿里云同步时间 cat /etc/chrony.conf server ntp1.aliyun.com iburst server ntp2.aliyun.com iburst server ntp3.aliyun.com iburst driftfile /var/lib/chrony/drift makestep 1.0 3 rtcsync allow 192.168.0.0/16 //允许大网段,我这里没做很多限制 local stratum 10 //权重,master的节点1,2,3的权重最好不一样,为10,11,12即可 logdir /var/log/chrony //修改一个从节点的chrony cat /etc/chrony.conf server 192.168.40.130 iburst //从三个master节点同步时间 server 192.168.40.131 iburst server 192.168.40.132 iburst driftfile /var/lib/chrony/drift makestep 1.0 3 rtcsync logdir /var/log/chrony //重启并开机自启后确认时间是否一致 systemctl restart chronyd;systemctl enable chronyd //关闭 SELINUX swapoff -a && sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab setenforce 0 && sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config //调整内核参数,对于 K8S cat > kubernetes.conf |
CopyRight 2018-2019 实验室设备网 版权所有 |